package com.wnxy.DAO;

import com.wnxy.shop.ShopApplication;
import com.wnxy.shop.entity.*;
import com.wnxy.shop.sqlprovider.SqlProvider;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;

/**
 * @author sunnylausong
 *
 * 输出sql provider所需语句
 * 2019/11/30
 * 21:48
 */
@RunWith(SpringRunner.class)
@SpringBootTest(classes = ShopApplication.class)
public class GetSqlString {
    @Test
    public void getSql()
    {
        SqlProvider provider = new SqlProvider() {
        };

        Judge entity = new Judge();

        // 插入语句
        System.out.println(provider.getInsertString(entity));
        // update 语句
        System.out.println("\r\n"+provider.getUpdateString(entity));
        // 条件查询
        System.out.println("\r\n"+provider.getQueryString(entity));
    }
}
